package com.demo.controller_admin;

import java.util.List;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.demo.dao_admin.ExamExamsDAO;
import com.demo.entity.ExamExams;
import com.demo.entity.ExamUser;

@Controller("adminExamexamsController")
@RequestMapping(value = "/${site.adminUrlPrefix}/examexams")
public class ExamexamsController {
	
	@Resource(name="adminExamExamsDAO")
	ExamExamsDAO examExamsDAO;

	/**
	 * 根据考试编号查询所有参考学生ID和分数
	 * @param id
	 * @return
	 */
	@GetMapping(value = "/{id}")
	public @ResponseBody ExamExams findById(@PathVariable("id") Long id) {
//		List<ExamUser> eu = examExamsDAO.findById(id).get().getExamUsers();
//		for (ExamUser u : eu) {
//			System.out.println(u.getCord()+"\t");
//		}
		return examExamsDAO.findById(id).get();
	}


}